package com.cg.design.graphicdesignpattern.bridge;

import java.util.Random;

/**
 * 类的功能层次结构：RandonCountDisplay类，继承CountDisplay，实现随机显示若干次数字符串功能
 *
 * @program: LeetCode->RandomCountDisplay
 * @description: 类的功能层次结构：RandonCountDisplay类，继承CountDisplay，实现随机显示若干次数字符串功能
 * @author: cg
 * @create: 2022-03-24 00:10
 **/
public class RandomCountDisplay extends CountDisplay {

    /**
     * 随机数生成器
     */
    private Random random = new Random();

    public RandomCountDisplay(DisplayImpl display) {
        super(display);
    }

    public void randomDisplay(int times) {
        multiDisplay(random.nextInt(times));
    }

}
